﻿<%@ Page Language="C#" AutoEventWireup="True" CodeBehind="EditUser.aspx.cs" Inherits="Medianamik.UI.Web.SecurityManagement.EditUser" 
MasterPageFile="../MasterPages/MedianamikModule.Master" %>

<asp:Content ID="ContextMenuContent" ContentPlaceHolderID="ContextMenu" runat="server">
    <asp:LinkButton ID="SaveBtn" runat="server" Text="<%$ Resources: Medianamik_Global, SaveButtonText %>"
        CssClass="Action BtSauvegarder SuspendLock" OnClick="Save" />
    <a href="<%= ReturnURL %>" class="Action BtAnnuler unlock"><%=Resources("Medianamik_Global", "Cancel") %></a>
</asp:Content>
<asp:Content ID="CenterContent" ContentPlaceHolderID="CenterContent" runat="server">
    <asp:UpdatePanel ID="MainUpdatePanel" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
        <ContentTemplate>
            <med:MedianamikFormTemplate HiddenProperties="<%# HiddenProperties %>" ID="FormTemplate"
                RadMultiPageId="MultiPage" RadTabStripId="TabStrip" runat="server" />
            <telerik:RadTabStrip ID="TabStrip" runat="server" EnableEmbeddedSkins="False" Skin="Medianamik"
                MultiPageID="MultiPage" SelectedIndex="0" ShowBaseLine="True">
                <Tabs>
                    <telerik:RadTab Text="<%$ Resources: Medianamik_SecurityManagement, UserTab %>" />
                    <telerik:RadTab Text="<%$ Resources: Medianamik_SecurityManagement, GroupsTab %>" />
                </Tabs>
            </telerik:RadTabStrip>
            <telerik:RadMultiPage ID="MultiPage" runat="server" SelectedIndex="0" CssClass="TabPage">
                <telerik:RadPageView ID="UserPageView" runat="server" CssClass="ContainerEditeurPage">
                   <div class="ContainerEditeurPage">
                        <h2><asp:Literal ID="SubTitle" runat="server" /></h2>
                        <asp:PlaceHolder ID="UserNameDatails" runat="server">
                            <div>
                                <asp:Label class="EditionPage" runat="server" AssociatedControlID="UserName"><img class="IconeLabel" 
                                    alt="" src="/Medianamik/images/Icones/Ico_ProprieteObligatoire.png"/>&nbsp;<asp:Literal 
                                        runat="server" Text="<%$Resources: Medianamik_SecurityManagement, UserNameLabel  %>" /></asp:Label>
                                <div class="EditionControl">
                                    <asp:TextBox id="UserName" style="width:300px;" runat="server" CssClass="TxtBox" 
                                        autocomplete="off" AutoCompleteType="Disabled" />
	                                <asp:RequiredFieldValidator ValidationGroup="B3483B9F573B4E3CB391FDFD069F8776" runat="server" Display="None" 
	                                    EnableClientScript="false" ControlToValidate="UserName" 
	                                    ErrorMessage="<%$ Resources: Medianamik_SecurityManagement, ErrorEmptyUsername  %>" />
	                                <asp:CustomValidator ValidationGroup="B3483B9F573B4E3CB391FDFD069F8776" runat="server" Display="None" EnableClientScript="false" 
	                                    OnServerValidate="UsernameValidate" ControlToValidate ="UserName" 
	                                    ErrorMessage = "<%$ Resources: Medianamik_SecurityManagement, UserAlreadyExistsError %>" />  
	                            </div>
                            </div>
                        </asp:PlaceHolder>
                        <asp:Label class="EditionPage" runat="server" AssociatedControlID="Email"><img class="IconeLabel" alt="" src="/Medianamik/images/Icones/Ico_ProprieteObligatoire.png"/>&nbsp;<asp:Literal runat="server" Text="<%$Resources: Medianamik_SecurityManagement, EmailLabel  %>" /></asp:Label>
                        <div class="EditionControl">
	                        <asp:TextBox runat="server" ID="Email" style="width:300px;" CssClass="TxtBox" autocomplete="off" AutoCompleteType="Disabled" />
                            <asp:RequiredFieldValidator  ValidationGroup="B3483B9F573B4E3CB391FDFD069F8776" runat="server" Display = "None" EnableClientScript="false" ControlToValidate ="Email" ErrorMessage="<%$ Resources: Medianamik_SecurityManagement, ErrorEmptyEmailAddress %>" />
                            <asp:RegularExpressionValidator ValidationGroup="B3483B9F573B4E3CB391FDFD069F8776" runat="server"  Display="None" EnableClientScript="false" ControlToValidate="Email" ErrorMessage="<%$ Resources: Medianamik_SecurityManagement, ErrorInvalidEmailAddress %>" ValidationExpression="^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}$" />
                        </div>
                        <div class="EditionControl">
	                        <asp:CheckBox runat="server" ID="Approved" Checked="true" Text="<%$ Resources: Medianamik_SecurityManagement, User_IsApprovedChekbox %>" />
	                    </div>
                        <asp:PlaceHolder ID="PasswordAndEmailConfigurations" runat="server">
                            <div class="EditionControl">
	                            <asp:CheckBox ID="SendEmail" runat="server" Enabled="false" Text="<%$ Resources: Medianamik_SecurityManagement, SendConfirmationEmailQuestion %>" Checked="true" />
	                        </div>
	                        <div class="EditionControl">
                                <asp:CheckBox runat="server" Checked="true" ID="AutoGeneratePwd" AutoPostBack="true" OnCheckedChanged ="AutoGeneratePwdCheckedChanged" Text="<%$ Resources: Medianamik_SecurityManagement, AutoGeneratePasswordLabel %>" />
                            </div>
                            <asp:PlaceHolder ID="PasswordAutoGeneration" runat="server">
                                <p><strong><asp:Literal runat="server" Text="<%$ Resources: Medianamik_SecurityManagement, PasswordWillBeAutoGenerated %>" /></strong></p>
                            </asp:PlaceHolder>
                        </asp:PlaceHolder>
                        <asp:PlaceHolder ID="PasswordDetails" runat="server" Visible="false">
                            <asp:Label class="EditionPage" runat="server" AssociatedControlID="Password"><asp:Literal runat="server" Text="<%$Resources: Medianamik_SecurityManagement, PasswordLabel  %>" /></asp:Label>
                            <div class="EditionControl">
                               <asp:TextBox id="Password" runat="server" CssClass="TxtBox" TextMode="Password" autocomplete="off" AutoCompleteType="Disabled" />
                               <asp:RequiredFieldValidator ValidationGroup="B3483B9F573B4E3CB391FDFD069F8776" runat="server" ID="PasswordRequired"  EnableClientScript="false" ControlToValidate="Password" Display="None" ErrorMessage="<%$ Resources: Medianamik_SecurityManagement, PasswordRequiredError %>" ></asp:RequiredFieldValidator>
                               <asp:CustomValidator ValidationGroup="B3483B9F573B4E3CB391FDFD069F8776" ID="PasswordStrength" runat="server" EnableClientScript="false" ControlToValidate="Password" Display="None" OnServerValidate="PasswordStrengthValidate" ErrorMessage="<%$ Resources: Medianamik_SecurityManagement, PasswordStrengthError %>" ></asp:CustomValidator>
                            </div>
                            <asp:Label class="EditionPage" runat="server" AssociatedControlID="ConfirmedPassword"><asp:Literal 
                                runat="server" Text="<%$Resources: Medianamik_SecurityManagement, PasswordConfirmationLabel  %>" /></asp:Label>
                            <div class="EditionControl">
                                <asp:TextBox ID="ConfirmedPassword" runat="server" CssClass="TxtBox" autocomplete="off" 
                                AutoCompleteType="Disabled" TextMode="Password" />
                            </div>
                            <div class="EditionControl">
                                <strong><asp:Literal runat="server" 
                                    Text="<%$ Resources: Medianamik_SecurityManagement, PasswordRulesLabel %>" /></strong>
                            </div>
                            <ul>
                                <li><asp:Literal runat="server" 
                                    Text="<%$Resources: Medianamik_SecurityManagement, MinRequiredPasswordLength %>" /><strong><%= Membership.MinRequiredPasswordLength  %></strong></li>
                                <li><asp:Literal ID="Literal3" runat="server" 
                                    Text="<%$Resources: Medianamik_SecurityManagement, MinRequiredNonAlphanumericCharacters %>" /><strong><%= Membership.MinRequiredNonAlphanumericCharacters  %></strong></li>
                            </ul>
                            <asp:CustomValidator ValidationGroup="B3483B9F573B4E3CB391FDFD069F8776" ID="PasswordCompare" runat="server" EnableClientScript="false" 
                                ControlToValidate="Password" Display="none" ValidateEmptyText="true"
                                OnServerValidate="PasswordCompareValidate" 
                                ErrorMessage="<%$ Resources: Medianamik_SecurityManagement, PasswordsDoNotMatchError %>" />   
                        </asp:PlaceHolder>
                    </div>
                </telerik:RadPageView>
                <telerik:RadPageView ID="RolesPageView" runat="server" CssClass="ContainerEditeurPage">
                    <div class="ContainerEditeurPage">
                        <asp:Label class="EditionPage" runat="server" AssociatedControlID="Groups"><img class="IconeLabel" 
                            alt="" src="/Medianamik/images/Icones/Ico_ProprieteObligatoire.png"/>&nbsp;<asp:Literal 
                                runat="server" Text="<%$Resources: Medianamik_SecurityManagement, GroupsLabel  %>" /></asp:Label>
                        <div class="EditionControl"><med:GroupCheckBoxList id="Groups" runat="server" /></div>
		            </div>
                </telerik:RadPageView>
            </telerik:RadMultiPage>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>